<?php include THEMES_PATH . 'public/before_body2.phtml'; ?>
<link href="/statics/front/css/measure.css?<?php echo C('update_vesion');?>" rel="stylesheet">
</head>
<body>
<?php include THEMES_PATH.'public/header2.phtml';?>
<div class="mt2x mb1x main-width progress-bar js-progress-bar">
  <em><?php echo L('measure_revision_1');?></em>
</div>
<form id="measureForm" method="post">
  <div class="main-width measure-content js-measure-content">
    <div class="measure-panel<?php if(!isset($_GET['get'])&& !$_GET['in']){echo ' current-page';}?>" style="<?php if(!isset($_GET['get'])&& !$_GET['in']){echo 'display:block';}else{echo 'display:none';}?>;">
      <p class="align-center mb1x title"><?php echo L('measure_revision_2');?></p>
      <div class="col-sm-6 video js-video">
        <video controls width="100%" type="video/mp4" poster="/statics/front/images/measure/0.jpg">
          <source src="/statics/front/video/<?php echo cookie('think_language'); ?>/intro.mp4" />
          <p class="red">Your browser does not support the video tag.</p>
        </video>
        <div class="control js-control"><img src="/statics/front/images/play.png" alt="点击播放"></div>
      </div>
      <div class="col-sm-6">
        <p class="mb1x"><?php echo L('measure_revision_3');?></p>
        <ul><?php echo L('measure_revision_4');?></ul>
      </div>
    </div>
     <?php if(in_array("neck",$data_arr)||$cart==0){?>
    <div class="measure-panel<?php if(!isset($_GET['get'])&& $_GET['in'] == 'neck'){echo ' current-page';}?>" <?php if(!isset($_GET['get'])&& $_GET['in'] == 'neck'){echo ' style="display:block;"';}else{echo ' style="display:none;"';}?>>
      <p class="align-center mb1x title"><?php echo L('neck_length');?></p>
      <div class="col-sm-6 video js-video">
        <video controls width="100%" type="video/mp4" data-poster="/statics/front/images/measure/1.jpg">
          <source data-src="/statics/front/video/<?php echo cookie('think_language'); ?>/neck.mp4" />
          <p class="red">Your browser does not support the video tag.</p>
        </video>
        <div class="control js-control"><img src="/statics/front/images/play.png" alt="点击播放"></div>
      </div>
      <div class="col-sm-6">
        <p class="mb1x"><?php echo L('measure_revision_7');?></p>
        <strong><?php echo L('neck_length');?></strong>
        <span>
          <input type="text" name="measure[neck][cm]" value="<?php echo isset($measure['neck']['cm']) ? $measure['neck']['cm'] : ''?>"> cm
        </span>
      </div>
    </div>
    <?php }?>
    <?php if(in_array("jacket_back",$data_arr)||$cart==0){?>
    <div class="measure-panel<?php if($_GET['in'] == 'shoulder'){echo ' current-page';}?>" <?php if($_GET['in'] == 'shoulder'){echo ' style="display:block;"';}else{echo ' style="display:none;"';}?>>
      <p class="align-center mb1x title"><?php echo L('jacket_back');?></p>
      <div class="col-sm-6 video js-video">
        <video controls width="100%" type="video/mp4" data-poster="/statics/front/images/measure/2.jpg">
          <source data-src="/statics/front/video/<?php echo cookie('think_language'); ?>/shoulder.mp4" />
          <p class="red">Your browser does not support the video tag.</p>
        </video>
        <div class="control js-control"><img src="/statics/front/images/play.png" alt="点击播放"></div>
      </div>
      <div class="col-sm-6">
        <ul>
          <li><?php echo L('measure_revision_8');?></li>
          <li><?php echo L('measure_revision_9');?></li>
        </ul>
        <strong><?php echo L('jacket_back');?></strong>
        <span>
          <input type="text" name="measure[jacket_back][cm]" value="<?php echo isset($measure['jacket_back']['cm']) ? $measure['jacket_back']['cm'] : ''?>"> cm
        </span>
      </div>
    </div>
    <?php }?>
    <?php if(in_array("bicep",$data_arr)||$cart==0){?>
    <div class="measure-panel<?php if($_GET['in'] == 'bicep'){echo ' current-page';}?>" <?php if($_GET['in'] == 'bicep'){echo ' style="display:block;"';}else{echo ' style="display:none;"';}?>>
      <p class="align-center mb1x title"><?php echo L('bicep_size');?></p>
      <div class="col-sm-6 video js-video">
        <video controls width="100%" type="video/mp4" data-poster="/statics/front/images/measure/3.jpg">
          <source data-src="/statics/front/video/<?php echo cookie('think_language'); ?>/bicep.mp4" />
          <p class="red">Your browser does not support the video tag.</p>
        </video>
        <div class="control js-control"><img src="/statics/front/images/play.png" alt="点击播放"></div>
      </div>
      <div class="col-sm-6">
        <ul>
          <li><?php echo L('measure_revision_10');?></li>
          <li><?php echo L('measure_revision_11');?></li>
        </ul>
        <strong><?php echo L('bicep_size');?></strong>
        <span>
          <input type="text" name="measure[bicep][cm]" value="<?php echo isset($measure['bicep']['cm']) ? $measure['bicep']['cm'] : ''?>" /> cm
        </span>
      </div>
    </div>
    <?php }?>
    <?php if(in_array("sleeve",$data_arr)||$cart==0){?>
    <div class="measure-panel<?php if($_GET['in'] == 'arm'){echo ' current-page';}?>" <?php if($_GET['in'] == 'arm'){echo ' style="display:block;"';}else{echo ' style="display:none;"';}?>>
      <p class="align-center mb1x title"><?php echo L('sleeve_length');?></p>
      <div class="col-sm-6 video js-video">
        <video controls width="100%" type="video/mp4" data-poster="/statics/front/images/measure/4.jpg">
          <source data-src="/statics/front/video/<?php echo cookie('think_language'); ?>/arm.mp4" />
          <p class="red">Your browser does not support the video tag.</p>
        </video>
        <div class="control js-control"><img src="/statics/front/images/play.png" alt="点击播放"></div>
      </div>
      <div class="col-sm-6">
        <ul>
          <li><?php echo L('measure_revision_13');?></li>
          <li><?php echo L('measure_revision_14');?></li>
          <li><?php echo L('measure_revision_15');?></li>
        </ul>
        <strong><?php echo L('sleeve_length');?></strong>
        <span>
          <input type="text" name="measure[sleeve][cm]" value="<?php echo isset($measure['sleeve']['cm']) ? $measure['sleeve']['cm'] : ''?>"> cm
        </span>
      </div>
    </div>
    <?php }?>
    <?php if(in_array("wrist",$data_arr)||$cart==0){?>
    <div class="measure-panel<?php if($_GET['in'] == 'wrist'){echo ' current-page';}?>" <?php if($_GET['in'] == 'wrist'){echo ' style="display:block;"';}else{echo ' style="display:none;"';}?>>
      <p class="align-center mb1x title"><?php echo L('wrist_size');?></p>
      <div class="col-sm-6 video js-video">
        <video controls width="100%" type="video/mp4" data-poster="/statics/front/images/measure/5.jpg">
          <source data-src="/statics/front/video/<?php echo cookie('think_language'); ?>/wrist.mp4" />
          <p class="red">Your browser does not support the video tag.</p>
        </video>
        <div class="control js-control"><img src="/statics/front/images/play.png" alt="点击播放"></div>
      </div>
      <div class="col-sm-6">
        <p class="mb1x"><?php echo L('measure_revision_16');?></p>
        <strong><?php echo L('wrist_size');?></strong>
        <span>
          <input type="text" name="measure[wrist][cm]" value="<?php echo isset($measure['wrist']['cm']) ? $measure['wrist']['cm'] : ''?>"> cm
        </span>
      </div>
    </div>
    <?php }?>
    <?php if(in_array("shirt",$data_arr)||$cart==0){?>
    <div class="measure-panel<?php if($_GET['in'] == 'torso'){echo ' current-page';}?>" <?php if($_GET['in'] == 'torso'){echo ' style="display:block;"';}else{echo ' style="display:none;"';}?>>
      <p class="align-center mb1x title"><?php echo L('shirt_length');?></p>
      <div class="col-sm-6 video js-video">
        <video controls width="100%" type="video/mp4" data-poster="/statics/front/images/measure/6.jpg">
          <source data-src="/statics/front/video/<?php echo cookie('think_language'); ?>/torso.mp4" />
          <p class="red">Your browser does not support the video tag.</p>
        </video>
        <div class="control js-control"><img src="/statics/front/images/play.png" alt="点击播放"></div>
      </div>
      <div class="col-sm-6">
        <ul>
          <li><?php echo L('measure_revision_17');?></li>
          <li><?php echo L('measure_revision_18');?></li>
        </ul>
        <strong><?php echo L('shirt_length');?></strong>
        <span>
          <input type="text" name="measure[shirt][cm]" value="<?php echo isset($measure['shirt']['cm']) ? $measure['shirt']['cm'] : ''?>"> cm
        </span>
      </div>
    </div>
    <?php }?>
    <?php if(in_array("chest",$data_arr)||$cart==0){?>
    <div class="measure-panel<?php if($_GET['in'] == 'chest'){echo ' current-page';}?>" <?php if($_GET['in'] == 'chest'){echo ' style="display:block;"';}else{echo ' style="display:none;"';}?>>
      <p class="align-center mb1x title"><?php echo L('chest_size');?></p>
      <div class="col-sm-6 video js-video">
        <video controls width="100%" type="video/mp4" data-poster="/statics/front/images/measure/7.jpg">
          <source data-src="/statics/front/video/<?php echo cookie('think_language'); ?>/chest.mp4" />
          <p class="red">Your browser does not support the video tag.</p>
        </video>
        <div class="control js-control"><img src="/statics/front/images/play.png" alt="点击播放"></div>
      </div>
      <div class="col-sm-6">
        <ul>
          <li><?php echo L('measure_revision_19');?></li>
          <li><?php echo L('measure_revision_20');?></li>
        </ul>
        <strong><?php echo L('chest_size');?></strong>
        <span>
          <input type="text" name="measure[chest][cm]" value="<?php echo isset($measure['chest']['cm']) ? $measure['chest']['cm'] : ''?>"> cm
        </span>
      </div>
    </div>
    <?php }?>
    <?php if(in_array("stomach",$data_arr)||$cart==0){?>
    <div class="measure-panel<?php if($_GET['in'] == 'stomach'){echo ' current-page';}?>" <?php if($_GET['in'] == 'stomach'){echo ' style="display:block;"';}else{echo ' style="display:none;"';}?>>
      <p class="align-center mb1x title"><?php echo L('stomack_size');?></p>
      <div class="col-sm-6 video js-video">
        <video controls width="100%" type="video/mp4" data-poster="/statics/front/images/measure/8.jpg">
          <source data-src="/statics/front/video/<?php echo cookie('think_language'); ?>/stomach.mp4" />
          <p class="red">Your browser does not support the video tag.</p>
        </video>
        <div class="control js-control"><img src="/statics/front/images/play.png" alt="点击播放"></div>
      </div>
      <div class="col-sm-6">
        <ul>
          <li><?php echo L('measure_revision_21');?></li>
          <li><?php echo L('measure_revision_22');?></li>
        </ul>
        <strong><?php echo L('stomack_size');?></strong>
        <span>
          <input type="text" name="measure[stomach][cm]" value="<?php echo isset($measure['stomach']['cm']) ? $measure['stomach']['cm'] : ''?>"> cm
        </span>
      </div>
    </div>
    <?php }?>
    <?php if(in_array("waist",$data_arr)||$cart==0){?>
    <div class="measure-panel<?php if($_GET['in'] == 'waist'){echo ' current-page';}?>" <?php if($_GET['in'] == 'waist'){echo ' style="display:block;"';}else{echo ' style="display:none;"';}?>>
      <p class="align-center mb1x title"><?php echo L('Waist');?></p>
      <div class="col-sm-6 video js-video">
        <video controls width="100%" type="video/mp4" data-poster="/statics/front/images/measure/9.jpg">
          <source data-src="/statics/front/video/<?php echo cookie('think_language'); ?>/waist.mp4" />
          <p class="red">Your browser does not support the video tag.</p>
        </video>
        <div class="control js-control"><img src="/statics/front/images/play.png" alt="点击播放"></div>
      </div>
      <div class="col-sm-6">
        <ul>
          <li><?php echo L('measure_revision_23');?></li>
          <li><?php echo L('measure_revision_24');?></li>
          <li><?php echo L('measure_revision_25');?></li>
        </ul>
        <strong><?php echo L('Waist');?></strong>
        <span>
          <input type="text" name="measure[waist][cm]" value="<?php echo isset($measure['waist']['cm']) ? $measure['waist']['cm'] : ''?>"> cm
        </span>
      </div>
    </div>
    <?php }?>
    <?php if(in_array("pants_hips",$data_arr)||$cart==0){?>
    <div class="measure-panel<?php if($_GET['in'] == 'seat'){echo ' current-page';}?>" <?php if($_GET['in'] == 'seat'){echo ' style="display:block;"';}else{echo ' style="display:none;"';}?>>
      <p class="align-center mb1x title"><?php echo L('pants_hips');?></p>
      <div class="col-sm-6 video js-video">
        <video controls width="100%" type="video/mp4" data-poster="/statics/front/images/measure/10.jpg">
          <source data-src="/statics/front/video/<?php echo cookie('think_language'); ?>/seat.mp4" />
          <p class="red">Your browser does not support the video tag.</p>
        </video>
        <div class="control js-control"><img src="/statics/front/images/play.png" alt="点击播放"></div>
      </div>
      <div class="col-sm-6">
        <ul>
          <li><?php echo L('measure_revision_26');?></li>
          <li><?php echo L('measure_revision_27');?></li>
        </ul>
        <strong><?php echo L('pants_hips');?></strong>
        <span>
          <input type="text" name="measure[pants_hips][cm]" value="<?php echo isset($measure['pants_hips']['cm']) ? $measure['pants_hips']['cm'] : ''?>"> cm
        </span>
      </div>
    </div>
    <?php }?>
    <?php if(in_array("pants",$data_arr)||$cart==0){?>
    <div class="measure-panel<?php if($_GET['in'] == 'leg'){echo ' current-page';}?>" <?php if($_GET['in'] == 'leg'){echo ' style="display:block;"';}else{echo ' style="display:none;"';}?>>
      <p class="align-center mb1x title"><?php echo L('pants_length');?></p>
      <div class="col-sm-6 video js-video">
        <video controls width="100%" type="video/mp4" data-poster="/statics/front/images/measure/11.jpg">
          <source data-src="/statics/front/video/<?php echo cookie('think_language'); ?>/leg.mp4" />
          <p class="red">Your browser does not support the video tag.</p>
        </video>
        <div class="control js-control"><img src="/statics/front/images/play.png" alt="点击播放"></div>
      </div>
      <div class="col-sm-6">
        <ul>
          <li><?php echo L('measure_revision_28');?></li>
          <li><?php echo L('measure_revision_29');?></li>
          <li><?php echo L('measure_revision_30');?></li>
        </ul>
        <strong><?php echo L('pants_length');?></strong>
        <span>
          <input type="text" name="measure[pants][cm]" value="<?php echo isset($measure['pants']['cm']) ? $measure['pants']['cm'] : ''?>"> cm
        </span>
      </div>
    </div>
    <?php }?>
    <?php if(in_array("crotch",$data_arr)||$cart==0){?>
    <div class="measure-panel<?php if($_GET['in'] == 'crotch'){echo ' current-page';}?>" <?php if($_GET['in'] == 'crotch'){echo ' style="display:block;"';}else{echo ' style="display:none;"';}?>>
      <p class="align-center mb1x title"><?php echo L('crotch');?></p>
      <div class="col-sm-6 video js-video">
        <video controls width="100%" type="video/mp4" data-poster="/statics/front/images/measure/12.jpg">
          <source data-src="/statics/front/video/<?php echo cookie('think_language'); ?>/crotch.mp4" />
          <p class="red">Your browser does not support the video tag.</p>
        </video>
        <div class="control js-control"><img src="/statics/front/images/play.png" alt="点击播放"></div>
      </div>
      <div class="col-sm-6">
        <ul>
          <li><?php echo L('measure_revision_31');?></li>
          <li><?php echo L('measure_revision_32');?></li>
          <li><?php echo L('measure_revision_33');?></li>
          <li><?php echo L('measure_revision_34');?></li>
          <li><?php echo L('measure_revision_35');?></li>
        </ul>
        <strong><?php echo L('crotch');?></strong>
        <span>
          <input type="text" name="measure[crotch][cm]" value="<?php echo isset($measure['crotch']['cm']) ? $measure['crotch']['cm'] : ''?>"> cm
        </span>
      </div>
    </div>
    <?php }?>
    <?php if(in_array("thigh",$data_arr)||$cart==0){?>
    <div class="measure-panel<?php if($_GET['in'] == 'thigh'){echo ' current-page';}?>" <?php if($_GET['in'] == 'thigh'){echo ' style="display:block;"';}else{echo ' style="display:none;"';}?>>
      <p class="align-center mb1x title"><?php echo L('thigh_size');?></p>
      <div class="col-sm-6 video js-video">
        <video controls width="100%" type="video/mp4" data-poster="/statics/front/images/measure/13.jpg">
          <source data-src="/statics/front/video/<?php echo cookie('think_language'); ?>/thigh.mp4" />
          <p class="red">Your browser does not support the video tag.</p>
        </video>
        <div class="control js-control"><img src="/statics/front/images/play.png" alt="点击播放"></div>
      </div>
      <div class="col-sm-6">
        <ul>
          <li><?php echo L('measure_revision_36');?></li>
          <li><?php echo L('measure_revision_37');?></li>
        </ul>
        <strong><?php echo L('thigh_size');?></strong>
        <span>
          <input type="text" name="measure[thigh][cm]" value="<?php echo isset($measure['thigh']['cm']) ? $measure['thigh']['cm'] : ''?>"> cm
        </span>
      </div>
    </div>
    <?php }?>
    <?php if(in_array("knee",$data_arr)||$cart==0){?>
    <div class="measure-panel<?php if($_GET['in'] == 'knee'){echo ' current-page';}?>" <?php if($_GET['in'] == 'knee'){echo ' style="display:block;"';}else{echo ' style="display:none;"';}?>>
      <p class="align-center mb1x title"><?php echo L('knee_size');?></p>
      <div class="col-sm-6 video js-video">
        <video controls width="100%" type="video/mp4" data-poster="/statics/front/images/measure/14.jpg">
          <source data-src="/statics/front/video/<?php echo cookie('think_language'); ?>/knee.mp4" />
          <p class="red">Your browser does not support the video tag.</p>
        </video>
        <div class="control js-control"><img src="/statics/front/images/play.png" alt="点击播放"></div>
      </div>
      <div class="col-sm-6">
        <ul>
          <li><?php echo L('measure_revision_38');?></li>
          <li><?php echo L('measure_revision_39');?></li>
        </ul>
        <strong><?php echo L('knee_size');?></strong>
        <span>
          <input type="text" name="measure[knee][cm]" value="<?php echo isset($measure['knee']['cm']) ? $measure['knee']['cm'] : ''?>"> cm
        </span>
      </div>
    </div>
    <?php }?>
    <div class="measure-panel physique-panel<?php if($_GET['get'] == 'physique'){echo ' current-page';}?>" style="<?php if($_GET['get'] == 'physique'){echo 'display:block;';}else{echo 'display:none;';}?>">
      <div class="physique js-physique">
        <p class="mb1x align-center title"><?php echo L('measure_physique');?></p>
        <dl class="pull-left">
          <dt>
            <strong><?php echo L('shoulders');?></strong>
            <?php if(isset($measure['shoulder']['type'])){?>
            <?php if($measure['shoulder']['type']==1){?>
            <em>(<?php echo L('square_shoulders');?>)</em>
            <?php }elseif($measure['shoulder']['type']==2){?>
            <em>(<?php echo L('between_square_and_rounder');?>)</em>
            <?php }elseif($measure['shoulder']['type']==3){?>
            <em>(<?php echo L('rounder_shoulders');?>)</em>
            <?php }elseif($measure['shoulder']['type']==4){?>
            <em>(<?php echo L('between_rounder_and_sloping');?>)</em>
            <?php }else{?>
            <em>(<?php echo L('sloping_shoulders');?>)</em>
            <?php }?>
            <?php }else{?>
            <em>(<?php echo L('rounder_shoulders');?>)</em>
            <?php }?>
            <input type="hidden" name="measure[shoulder][type]" value="<?php echo isset($measure['shoulder']['type']) ? $measure['shoulder']['type'] : '3'?>">
          </dt>
          <dd<?php if($measure['shoulder']['type'] == 1){echo ' class="active" ';}?> data-physique="<?php echo L('square_shoulders');?>" data-physique-val="1">
            <img src="/statics/front/images/measure/shoulders1.jpg">
            <img src="/statics/front/images/measure/shoulders1-1.jpg" class="bright">
            <p><?php echo L('square_shoulders');?></p>
            <i class="mark"></i>
          </dd>
          <dd<?php if($measure['shoulder']['type'] == 3 || !isset($measure['shoulder']['type'])){echo ' class="active" ';}?> data-physique="<?php echo L('rounder_shoulders');?>" data-physique-val="3">
            <img src="/statics/front/images/measure/shoulders2.jpg">
            <img src="/statics/front/images/measure/shoulders2-1.jpg" class="bright">
            <p><?php echo L('rounder_shoulders');?></p>
            <i class="mark"></i>
          </dd>
          <dd<?php if($measure['shoulder']['type'] == 5){echo ' class="active" ';}?> data-physique="<?php echo L('sloping_shoulders');?>" data-physique-val="5">
            <img src="/statics/front/images/measure/shoulders3.jpg">
            <img src="/statics/front/images/measure/shoulders3-1.jpg" class="bright">
            <p><?php echo L('sloping_shoulders');?></p>
            <i class="mark"></i>
          </dd>
        </dl>
        <dl class="pull-right">
          <dt>
            <strong><?php echo L('chest');?></strong>
            <?php if(isset($measure['chest']['type'])){?>
            <?php if($measure['chest']['type']==1){?>
            <em>(<?php echo L('muscular_chest');?>)</em>
            <?php }elseif($measure['chest']['type']==2){?>
            <em>(<?php echo L('between_muscular_and_flat');?>)</em>
            <?php }elseif($measure['chest']['type']==3){?>
            <em>(<?php echo L('flat_chest');?>)</em>
            <?php }elseif($measure['chest']['type']==4){?>
            <em>(<?php echo L('between_flat_and_large');?>)</em>
            <?php }else{?>
            <em>(<?php echo L('large_chest');?>)</em>
            <?php }?>
            <?php }else{?>
            <em>(<?php echo L('flat_chest');?>)</em>
            <?php }?>
            <input type="hidden" name="measure[chest][type]" value="<?php echo isset($measure['chest']['type']) ? $measure['chest']['type'] : '3'?>">
          </dt>
          <dd<?php if($measure['chest']['type'] == 1){echo ' class="active" ';}?> data-physique="<?php echo L('muscular_chest');?>" data-physique-val="1">
            <img src="/statics/front/images/measure/chest1.jpg">
            <img src="/statics/front/images/measure/chest1-1.jpg" class="bright">
            <p><?php echo L('muscular_chest');?></p>
            <i class="mark"></i>
          </dd>
          <dd<?php if($measure['chest']['type'] == 3 || !isset($measure['chest']['type'])){echo ' class="active" ';}?> data-physique="<?php echo L('flat_chest');?>" data-physique-val="3">
            <img src="/statics/front/images/measure/chest2.jpg">
            <img src="/statics/front/images/measure/chest2-1.jpg" class="bright">
            <p><?php echo L('flat_chest');?></p>
            <i class="mark"></i>
          </dd>
          <dd<?php if($measure['chest']['type'] == 5){echo ' class="active" ';}?> data-physique="<?php echo L('large_chest');?>" data-physique-val="5">
            <img src="/statics/front/images/measure/chest3.jpg">
            <img src="/statics/front/images/measure/chest3-1.jpg" class="bright">
            <p><?php echo L('large_chest');?></p>
            <i class="mark"></i>
          </dd>
        </dl>
        <dl class="pull-left">
          <dt>
            <strong><?php echo L('flat_stomach_1');?></strong>
            <?php if(isset($measure['stomach']['type'])){?>
            <?php if($measure['stomach']['type']==1){?>
            <em>(<?php echo L('flat_stomach ');?>)</em>
            <?php }elseif($measure['stomach']['type']==2){?>
            <em>(<?php echo L('between_flat_and_slightly_rounded ');?>)</em>
            <?php }elseif($measure['stomach']['type']==3){?>
            <em>(<?php echo L('slightly_rounded_stomach');?>)</em>
            <?php }elseif($measure['stomach']['type']==4){?>
            <em>(<?php echo L('between_slightly_rounded _and_rounded');?>)</em>
            <?php }else{?>
            <em>(<?php echo L('rounded_stomach');?>)</em>
            <?php }?>
            <?php }else{?>
            <em>(<?php echo L('slightly_rounded_stomach');?>)</em>
            <?php }?>
            <input type="hidden" name="measure[stomach][type]" value="<?php echo isset($measure['stomach']['type']) ? $measure['stomach']['type'] : '3'?>">
          </dt>
          <dd<?php if($measure['stomach']['type'] == 1){echo ' class="active" ';}?> data-physique="<?php echo L('flat_stomach ');?>" data-physique-val="1">
            <img src="/statics/front/images/measure/stomach1.jpg">
            <img src="/statics/front/images/measure/stomach1-1.jpg" class="bright">
            <p><?php echo L('flat_stomach ');?></p>
            <i class="mark"></i>
          </dd>
          <dd<?php if($measure['stomach']['type'] == 3 || !isset($measure['stomach']['type'])){echo ' class="active" ';}?> data-physique="<?php echo L('slightly_rounded_stomach');?>" data-physique-val="3">
            <img src="/statics/front/images/measure/stomach2.jpg">
            <img src="/statics/front/images/measure/stomach2-1.jpg" class="bright">
            <p><?php echo L('slightly_rounded_stomach');?></p>
            <i class="mark"></i>
          </dd>
          <dd<?php if($measure['stomach']['type'] == 5){echo ' class="active" ';}?> data-physique="<?php echo L('rounded_stomach');?>" data-physique-val="5">
            <img src="/statics/front/images/measure/stomach3.jpg">
            <img src="/statics/front/images/measure/stomach3-1.jpg" class="bright">
            <p><?php echo L('rounded_stomach');?></p>
            <i class="mark"></i>
          </dd>
        </dl>
        <dl class="pull-right">
          <dt>
            <strong><?php echo L('flat_posture_1');?></strong>
            <?php if(isset($measure['posture']['type'])){?>
            <?php if($measure['posture']['type']==1){?>
            <em>(<?php echo L('flat_posture');?>)</em>
            <?php }elseif($measure['posture']['type']==2){?>
            <em>(<?php echo L('between_flat_and_straight');?>)</em>
            <?php }elseif($measure['posture']['type']==3){?>
            <em>(<?php echo L('straight_posture');?>)</em>
            <?php }elseif($measure['posture']['type']==4){?>
            <em>(<?php echo L('between_straight_and_relaxed');?>)</em>
            <?php }else{?>
            <em>(<?php echo L('relaxed_posture');?>)</em>
            <?php }?>
            <?php }else{?>
            <em>(<?php echo L('straight_posture');?>)</em>
            <?php }?>
            <input type="hidden" name="measure[posture][type]" value="<?php echo isset($measure['posture']['type']) ? $measure['posture']['type'] : '3'?>">
          </dt>
          <dd<?php if($measure['posture']['type'] == 1){echo ' class="active" ';}?> data-physique="<?php echo L('flat_posture');?>" data-physique-val="1">
            <img src="/statics/front/images/measure/posture2.jpg">
            <img src="/statics/front/images/measure/posture2-1.jpg" class="bright">
            <p><?php echo L('flat_posture');?></p>
            <i class="mark"></i>
          </dd>
          <dd<?php if($measure['posture']['type'] == 3 || !isset($measure['posture']['type'])){echo ' class="active" ';}?> data-physique="<?php echo L('straight_posture');?>" data-physique-val="3">
            <img src="/statics/front/images/measure/posture1.jpg">
            <img src="/statics/front/images/measure/posture1-1.jpg" class="bright">
            <p><?php echo L('straight_posture');?></p>
            <i class="mark"></i>
          </dd>
          <dd<?php if($measure['posture']['type'] == 5){echo ' class="active" ';}?> data-physique="<?php echo L('relaxed_posture');?>" data-physique-val="5">
            <img src="/statics/front/images/measure/posture3.jpg">
            <img src="/statics/front/images/measure/posture3-1.jpg" class="bright">
            <p><?php echo L('relaxed_posture');?></p>
            <i class="mark"></i>
          </dd>
        </dl>
      </div>
    </div>
  </div>
  <div class="main-width align-right btn-group"<?php if($measure && !$_GET['status']):?> style="padding-right:0;"<?php endif;?>>
    <?php if(!$measure):?>
    <input type="hidden" name="measure_name" value="<?php echo $measureBeginCookie['name']?>">
    <input type="hidden" name="measure[age]" value="<?php echo $measureBeginCookie['age']?>">
    <input type="hidden" name="measure[height][cm]" value="<?php echo $measureBeginCookie['height']?>">
    <input type="hidden" name="measure[weight][kg]" value="<?php echo $measureBeginCookie['weight']?>">
    <input type="hidden" name="unit" value="<?php echo $measureBeginCookie['m_unit']?>">
    <?php endif;?>
    <input type="hidden" name="dosubmit" value="1">

    <button type="button" class="pull-left btn hide prev js-prev"><?php echo L('_PAGE_PREV_');?></button>
    <button type="button" class="btn next js-next" data-text="<?php echo L('_PAGE_NEXT_');?>"><?php if(!$_GET['in']){echo L('measure_revision_40');}else{echo L('_PAGE_NEXT_');}?></button>
    <?php if(!$_GET['mid'] || $_GET['status'] == 2):?>
    <button type="submit" class="btn hide submit js-submit"><?php echo L('submit');?></button>
    <?php endif;?>
    <?php if($measure && !$_GET['status']):?><!-- 修改量尺量体时的提交按钮 -->
    <button type="submit" class="pull-right btn submit submit-for-edit js-submit-for-edit"><?php echo L('_Save_Quit_');?></button>
    <?php endif;?>
  </div>
</form>
<?php include THEMES_PATH.'public/measure_guide.phtml';?>
<script>
$(function() {
  var $progressBar = $('.js-progress-bar'),
      $progressBarTip = $progressBar.children().eq(0),
      $measureForm = $('#measureForm'),
      $measureCnt = $measureForm.find('.js-measure-content');

  (function () {//视频控制
    var $visibleVideo = $measureCnt.find('video:visible'),
        $visibleVideoSource = $visibleVideo.find('source');

    if(!$visibleVideo.attr('poster')) {
      $visibleVideo.attr('poster', $visibleVideo.data('poster'));
    }

    if(!$visibleVideo.attr('src')) {
      $visibleVideo.attr('src', $visibleVideoSource.data('src'));
    }

    if ($visibleVideo[0] && !document.createElement('video').canPlayType) {
      $visibleVideo.siblings('.js-control').addClass('hide');
    }

    $measureForm
      .on('click', '.js-control', function () {
        $(this).stop(true, false).fadeOut().siblings('video')[0].play();
      })
      .find('video').each(function () {
        var video = this;

        if (typeof video.addEventListener === 'function') {
          video.addEventListener('playing', function() {
            $(video).siblings('.js-control').stop(true, false).fadeOut();
          }, false);
        } else {
          video.onplaying = function () {
            $(video).siblings('.js-control').stop(true, false).fadeOut();
          }
        }
      });
  }());

  (function() {//进度条
    var html = '',
        count = $measureCnt.children('div').length,
        currentIndex = $measureCnt.children('div').filter(':visible').index(),
        unitWidth = Math.floor($progressBar.width() / count);

    for (var i = 0; i < count; i++) {
      html += '<li' + (i === 0 ? ' class="complete"' : '') + ' style="width:' + unitWidth + 'px;"><i></i></li>';
    }

    $progressBar.append('<ul>' + html + '</ul>').find('li').each(function(index) {
      if (index <= currentIndex) {
        $(this).addClass('complete');
      } else {
        return false;
      }
    });

    $progressBarTip.text('第 ' + (currentIndex + 1) + ' 步，共 ' + $measureCnt.children('div').length + ' 步').css('left', $progressBar.find('li').eq(0).outerWidth() * (currentIndex + 1) - $progressBarTip.width() / 2);
  })();

  switchShow({
    prev: $('.js-prev', $measureForm),
    next: $('.js-next', $measureForm),
    panel: $measureCnt.children('div'),
    displacement: $measureCnt.children('div').eq(0).outerWidth(),
    animation: 'none',
    beforeSwitch: function(index, eventTargetCode) {
      var $field = $('.js-measure-content', $measureForm).children('div').eq(index).find('input[type=text]').filter(':visible'),
          fieldVal = '',
          required = false,
          empty = /^\s*$/;

      if (index > 0 && eventTargetCode === 1) {
        $field.on('blur', function() {
          $(this).removeClass('error').siblings('input.error').removeClass('error');
          $(this).siblings('.error.msg').hide();
        });

        fieldVal = $field.val();

        if ( empty.test(fieldVal) || isNaN(Number(fieldVal)) || Number(fieldVal) === 0 ) {
          $field.addClass('error').focus();
          if ($field.next('.error.msg').length) {
            $field.next().show();
          } else {
            $field.after("<p class='error msg'><?php L('number_tips');?></p>");
          }
          return false;
        }
      }
    },
    onSwitch: function(index, eventTargetCode) {
      var $prev = $('.js-prev', $measureForm),
          $next = $('.js-next', $measureForm),
          $submit = $('.js-submit', $measureForm),
          $submitForEdit = $('.js-submit-for-edit', $measureForm),
          $measurePanel = $measureCnt.children('div'),
          $currentPanel = $measurePanel.eq(index),
          $prevVideo = $currentPanel.prev().find('video'),
          count = $measurePanel.length;

      $progressBar.find('li:lt(' + (index + 1) + ')').addClass('complete');
      $progressBar.find('li:gt(' + index + ')').removeClass('complete');

      $currentPanel.addClass('current-page').siblings().removeClass('current-page');

      if ($prevVideo[0]) {
        if (!!document.createElement('video').canPlayType) {
          $prevVideo[0].pause();
        } else {
          $currentPanel.find('.js-control').addClass('hide');
        }
      }

      if (index === 0) {
        $prev.addClass('hide');
      } else {
        //视频控制
        var _video = $currentPanel.find('video'),
            _source = _video.find('source');
        if(!_video.attr('poster')) {
          _video.attr('poster', _video.data('poster'));
        }
        if(!_video.attr('src')) {
          _video.attr('src', _source.data('src'));
        }

        $prev.filter(':hidden').removeClass('hide');
        $next.html($next.data('text') + '<i></i>');

        if (index === count - 1) {//最后一页
          $progressBarTip.text('第 ' + (index + 1) + ' 步，共 ' + count + ' 步').css({'right': 0, 'left': 'auto'});
          $next.addClass('hide');
          $submit.removeClass('hide');
        } else {
          $prev.removeAttr('style');
        }
      }

      if (index < count - 1) {
        $progressBarTip.text('第 ' + (index + 1) + ' 步，共 ' + count + ' 步').css({'right': 'auto', 'left': $progressBar.find('li').eq(0).outerWidth() * (index + 1) - $progressBarTip.width() / 2});
        $next.removeClass('hide');
        $submit.addClass('hide');
      }

      $currentPanel.find('input[type=text][name^=measure]').filter(':visible').eq(0).focus();
    }
  });

  $(document).on({
    'keydown': function(event) {
      if (event.keyCode === 13) {
        if ($measureCnt.children('div').last().is(':hidden')) {//如果不是最后一页，则禁止回车键提交表单
          $measureForm.find('.js-next').trigger('click');
          return false;
        } else {
          $measureForm.submit();
        }
      }
    }
  });
});
</script>
<?php include THEMES_PATH.'public/footer2.phtml';?>
<?php include THEMES_PATH.'public/after_body.phtml';?>